package day11.gec.work;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.Statement;

public class Work1 {
	public static void main(String[] args) throws Exception {
		/*贾链欲执事*/
		Class.forName("com.mysql.jdbc.Driver");
		
		//连接对象
		Connection conn = DriverManager.getConnection("jdbc:mysql:///hrm","root","root");
		
		//语句对象
		Statement st = conn.createStatement();
		
		//准备sql
		String sql = "CREATE TABLE student(s_no INT PRIMARY KEY AUTO_INCREMENT,s_name VARCHAR(10),s_sex VARCHAR(2),s_score DOUBLE(3,1),s_addf DOUBLE(3,1))";
		st.executeUpdate(sql);
		
		System.out.println("创建表ok...");
		
		//关闭资源 
		st.close();
		conn.close();
	}
}
